unit uAppUI;

interface

uses
  Classes, Graphics, Controls, StdCtrls, ExtCtrls, jpeg, GIFImg, Menus;

procedure LoadMainFormBanner(container: TPanel);
procedure CustomizeMenu(Menu: TMenu);

implementation

{$r banner.res}

procedure LoadJPEGFromResName(Picture: TPicture; const ResName: string);
var
  jpegImage: TJPEGImage;
  res: TStream;
begin
  jpegImage := TJPEGImage.Create;
  try
    res := TResourceStream.Create(HInstance, ResName, 'JPEG');
    try
      jpegImage.LoadFromStream(res);
      Picture.Graphic := jpegImage;
    finally
      res.Free;
    end;
  finally
    jpegImage.Free;
  end;
end;

procedure LoadGIFFromResName(Picture: TPicture; const ResName: string);
var
  gifImage: TGIFImage;
  res: TStream;
begin
  gifImage := TGIFImage.Create;
  try
    res := TResourceStream.Create(HInstance, ResName, 'GIF');
    try
      gifImage.LoadFromStream(res);
      Picture.Graphic := gifImage;
    finally
      res.Free;
    end;
  finally
    gifImage.Free;
  end;
end;

procedure LoadMainFormBanner(container: TPanel);
var
  Image: TImage;
begin
  container.Height := 70;

  Image := TImage.Create(container);
  Image.Stretch := True;
  LoadJPEGFromResName(Image.Picture, 'banner3');
  Image.Visible := True;
  Image.Parent := container;
  Image.Align := alClient;

  Image := TImage.Create(container);
  Image.AutoSize := True;
  LoadJPEGFromResName(Image.Picture, 'banner1');
  Image.Visible := True;
  Image.Parent := container;
  Image.Align := alLeft;
  Image.BringToFront;

  Image := TImage.Create(container);
  Image.AutoSize := True;
  LoadGIFFromResName(Image.Picture, 'banner2');
  Image.Visible := True;
  Image.Parent := container;
  Image.Align := alRight;
  Image.BringToFront;
end;

procedure CustomizeMenu(Menu: TMenu);
begin

end;

end.
